<!DOCTYPE html>
<html th:replace="layout/layout"
      xmlns:th="http://www.thymeleaf.org">
<title th:fragment="titleName">用户管理</title>
<style th:fragment="styles">
</style>
<div id="customModule" th:fragment="content">
    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-lg-10">
            <h2>商户管理</h2>
            <ol class="breadcrumb">
                <li>
                    <a href="/index">Home</a>
                </li>
                <li>
                    <a>系统管理</a>
                </li>
                <li class="active">
                    <strong>商户管理</strong>
                </li>
            </ol>
        </div>
        <div class="col-lg-2">

        </div>
    </div>
    <div class="wrapper wrapper-content  animated fadeInRight">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox ">
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-lg-3">
                                <div class="form-group">
                                    <input autocomplete="off" class="form-control" id="UserNameCondition"
                                           name="UserNameCondition"
                                           placeholder="用户名"
                                           type="text" v-model="UserNameCondition">
                                </div>
                            </div>

                            <div class="col-lg-2">
                                <div class="form-group">
                                    <select class="form-control" id='userTypeCondition' name='userTypeCondition'
                                            v-model="userTypeCondition">
                                        <option value="-1">--全部--</option>
                                        <option value="1">公司</option>
                                        <option value="2">合伙人</option>
                                        <option value="3">服务商</option>
                                        <option value="4">商户</option>
                                        <option value="5">会员</option>
                                        <option value="6">非会员</option>
                                    </select>
                                </div>
                            </div>
                            <div class="col-lg-2">
                                <div class="form-group">
                                    <select class="form-control" id='activityCondition' name='activityCondition'
                                            v-model="activityCondition">
                                        <option value="-1">--全部状态--</option>
                                        <option value="1">已激活</option>
                                        <option value="0">未激活</option>
                                    </select>
                                </div>
                            </div>
                            <div class="col-lg-2">
                                <button @click="search()" class="btn btn-primary  btn-rounded  btn-sm" id="search"
                                        type="submit"><i
                                        class="fa fa-search"></i>&nbsp;搜索
                                </button>
                                <button @click="reset()" class="btn btn-warning  btn-rounded  btn-sm" id="refresh"
                                        type="submit"><i
                                        class="fa fa-refresh"></i>&nbsp;重置
                                </button>
                            </div>
                        </div>
                        <div class="jqGrid_wrapper">
                            <div class="btn-group-sm" id="toolbar" role="group">
                                <a @click="addRecord();" class="btn btn-success" data-toggle="modal"
                                   id="AddNew" name="AddNew">
                                    <i class="fa fa-plus"></i> 创建用户
                                </a>
                                <!--<a class="btn btn-primary single disabled">-->
                                <!--<i class="fa fa-edit"></i> 修改-->
                                <!--</a>-->
                                <!--<a class="btn btn-danger multiple disabled">-->
                                <!--<i class="fa fa-remove"></i> 删除-->
                                <!--</a>-->
                            </div>

                            <table class="table table-striped table-bordered table-hover " id="tableList">
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--模态框-->
    <div aria-hidden="true" class="modal inmodal" id="myModalAdd" role="dialog" tabindex="-1">
        <div class="modal-dialog  modal-lg">
            <div class="modal-content animated bounceInRight">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal" type="button"><span
                            aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title">用户信息</h4>
                </div>
                <div class="modal-body">
                    <div class="tabs-container">
                        <ul class="nav nav-tabs" id="tabList">
                            <li class="active" id="tab1"><a data-toggle="tab" href="#tab-1"> 用户信息</a></li>
                            <li class=""><a data-toggle="tab" href="#tab-2">银行信息</a></li>
                            </li>
                        </ul>
                        <div class="tab-content">
                            <div class="tab-pane active" id="tab-1">
                                <div class="panel-body">
                                    <form class="form-horizontal" id="myform">
                                        <div class="row">
                                            <label class="col-lg-2 control-label">用户编号</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <input autocomplete="off" class="form-control" id="userID"
                                                           maxlength="20" name="userID" placeholder="用户编号"
                                                           readonly="readonly" type="text" v-model="userID">
                                                </div>
                                            </div>
                                            <label class="col-lg-2 control-label">登录名</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <input autocomplete="off" class="form-control" id="userName"
                                                           maxlength="20" name="userName" placeholder="系统登录用户名"
                                                           type="text" v-model="userName"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <label class="col-lg-2 control-label">是否激活</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <select class="form-control" id='activity' name='activity'
                                                            v-model="activity">
                                                        <option value="1">激活</option>
                                                        <option value="0">未激活</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <label class="col-lg-2 control-label">所属角色</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <select class="form-control" v-model="roleID">
                                                        <option :value="item.id" v-for="(item,index) in roleList">
                                                            {{item.name}}
                                                        </option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row"  style="display: none">
                                            <label class="col-lg-2 control-label">预存金额</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <input autocomplete="off" class="form-control"
                                                           maxlength="12" placeholder="预存金额" type="text"
                                                           v-model="storedAmount">
                                                </div>
                                            </div>
                                            <label class="col-lg-2 control-label">剩余预存金额</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <input autocomplete="off" class="form-control"
                                                           maxlength="12" placeholder="剩余预存金额" type="text"
                                                           v-model="amount">
                                                </div>
                                            </div>
                                        </div>


                                        <div class="row">
                                            <label class="col-lg-2 control-label">性别</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <select class="form-control" id='sex' name='sex'
                                                            v-model="sex">
                                                        <option value="1">男</option>
                                                        <option value="0">女</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <label class="col-lg-2 control-label">上级商户</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <input autocomplete="off" class="form-control"
                                                           maxlength="50" placeholder="上级商户" readonly="readonly"
                                                           type="text" v-model="parentName">
                                                    <input autocomplete="off" class="form-control"
                                                           maxlength="50" placeholder="上级用户" style="display: none"
                                                           type="text" v-model="parentID">
                                                </div>
                                            </div>
                                        </div>


                                        <div class="row">
                                            <label class="col-lg-2 control-label">邮箱</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <input autocomplete="off" class="form-control"
                                                           maxlength="50" placeholder="邮箱" type="text"
                                                           v-model="email">
                                                </div>
                                            </div>
                                            <label class="col-lg-2 control-label">用户类型</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <select class="form-control" v-model="roleID">
                                                        <option :value="item.id" v-for="(item,index) in roleList">
                                                            {{item.name}}
                                                        </option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row"  style="display: none">
                                            <label class="col-lg-2 control-label">登录Key</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <input autocomplete="off" class="form-control"
                                                           maxlength="50" placeholder="登录Key" type="text"
                                                           v-model="secret" readonly="readonly" >
                                                </div>
                                            </div>
                                            <label class="col-lg-2 control-label">创建时间</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <input autocomplete="off" class="form-control"
                                                           maxlength="50" placeholder="创建时间" readonly="readonly"
                                                           type="text" v-model="createDateTime">
                                                </div>
                                            </div>


                                        </div>
                                        <div class="row" style="display: none">
                                            <label class="col-lg-2 control-label">结算Key</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <input autocomplete="off" class="form-control"
                                                           maxlength="50" placeholder="结算Key" type="text"
                                                           v-model="secret2" readonly="readonly" >
                                                </div>
                                            </div>
                                            <label class="col-lg-2 control-label">权重</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <input autocomplete="off" class="form-control"
                                                           maxlength="10" placeholder="权重" type="text"
                                                           v-model="weight">
                                                </div>
                                            </div>
                                        </div>




                                    </form>
                                </div>
                            </div>
                            <div class="tab-pane" id="tab-2">
                                <div class="panel-body">
                                    <strong>支付信息</strong>
                                    <form class="form-horizontal">
                                        <div class="row">
                                            <label class="col-lg-2 control-label">银行卡号</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <input autocomplete="off" class="form-control"
                                                           maxlength="50" placeholder="银行卡号" type="text"
                                                           v-model="bankNo">
                                                </div>
                                            </div>
                                            <label class="col-lg-2 control-label">持卡人</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <input autocomplete="off" class="form-control"
                                                           maxlength="50" placeholder="持卡人" type="text"
                                                           v-model="bankUserName">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <label class="col-lg-2 control-label">联系电话</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <input autocomplete="off" class="form-control"
                                                           maxlength="50" placeholder="联系电话" type="text"
                                                           v-model="phone">
                                                </div>
                                            </div>
                                            <label class="col-lg-2 control-label">银行名称</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <input autocomplete="off" class="form-control"
                                                           maxlength="50" placeholder="银行名称" type="text"
                                                           v-model="bankName">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <label class="col-lg-2 control-label">支付宝</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <input autocomplete="off" class="form-control"
                                                           maxlength="50" placeholder="支付宝" type="text"
                                                           v-model="alipay">
                                                </div>
                                            </div>
                                            <label class="col-lg-2 control-label">微信</label>
                                            <div class="col-lg-4">
                                                <div class="form-group">
                                                    <input autocomplete="off" class="form-control"
                                                           maxlength="50" placeholder="微信" type="text"
                                                           v-model="weixinpay">
                                                </div>
                                            </div>
                                        </div>

                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button @click="saveRecord();" class="btn btn-success" id="save" name="save" type="button"
                            v-if="clickState=='edit'||clickState=='add'"><i
                            class="fa fa-save"></i>&nbsp;保存
                    </button>
                    <button class="btn btn-danger" data-dismiss="modal" id="close" name="close" type="button"><i
                            class="fa fa-close"></i>&nbsp;关 闭
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:fragment="scriptRef">
    <script th:src="@{/js/user/User.js}"></script>
</div>

<script th:fragment="scripts" type="text/javascript">
    User.init();
    $('.i-checks').iCheck({
        checkboxClass: 'icheckbox_square-green',
        radioClass: 'iradio_square-green',
    });
</script>
</html>